package com.codejam.winter.controller;

import com.codejam.winter.controller.request.GetUserInfoReqDTO;
import com.codejam.winter.dal.dataobject.User;
import com.codejam.winter.service.interfaces.IServiceUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Admin
 */
@Slf4j
@RequestMapping("/user")
@RestController
public class UserController {

    @Autowired
    private IServiceUser serviceUser;

    @RequestMapping(value = "/getUserInfo",method = RequestMethod.POST)
    public String getUserInfo(@RequestBody GetUserInfoReqDTO request){

        User user = serviceUser.getUser();

        log.debug("debug1" + UserController.class.getName());
        log.info("info1" + UserController.class.getName());
        log.warn("warn1" + UserController.class.getName());
        log.error("error1" + UserController.class.getName());
        log.trace("trace1" + UserController.class.getName());

        return user.toString();
    }
}
